home *** CD-ROM | disk | FTP | other *** search
- Path: news.nodak.edu!plains!jengel
- From: jengel@plains.nodak.edu (John H. Engel)
- Newsgroups: comp.lang.c++
- Subject: Help with derived class of ifstream class
- Date: 8 Mar 1996 03:56:39 GMT
- Organization: North Dakota Higher Education Computing Network (NDHECN)
- Message-ID: <4hob5n$65c@daily-planet.nodak.edu>
- NNTP-Posting-Host: plains.nodak.edu
- Mime-Version: 1.0
- Content-Type: text/plain; charset=US-ASCII
- Content-Transfer-Encoding: 7bit
- X-Newsreader: TIN [version 1.2 PL2]
-
- I have been unsuccessful trying to compile the following code:
-
- #include <iostream.h>
- #include <fstream.h>
- class X:public ifstream{
- public:
- int read();
- X(char *s):ifstream(s){;};
- };
-
- int X::read(){
- int i;
- (*this) >> i; // this is ok
- (*this) >> hex >> i; // compiler does not like this
- };
-
- The error I get is
- no match for 'operator >>(class X, enum ios::{anonymous})'
- I am using g++ 2.7. Thanks in advance.
-
- --
- John Engel
- jengel@plains.nodak.edu
- http://www.cs.ndsu.nodak.edu/~jengel
-
-